using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Controls
{
    public class Utility
    {
        public static string GetWebFont(Font objFont)
        {
            string strFont = "";
            if (objFont.Italic) strFont += "italic ";
            else strFont += "normal ";
            strFont += "normal ";
            if (objFont.Bold) strFont += "bold ";
            else strFont += "normal ";
            switch (objFont.Unit)
            {
                case GraphicsUnit.Pixel:
                    strFont += objFont.Size + "px ";
                    break;
                case GraphicsUnit.Point:
                    strFont += objFont.Size + "pt ";
                    break;
                case GraphicsUnit.Inch:
                    strFont += objFont.Size + "in ";
                    break;
                case GraphicsUnit.Millimeter:
                    strFont += objFont.Size + "mm ";
                    break;
            }

            strFont += objFont.FontFamily.Name + " ";


            if (objFont.Underline)
            {
                strFont += ";text-decoration:underline";
            }
            else if (objFont.Strikeout)
            {
                strFont += ";text-decoration:line-through";
            }
            return strFont;
        }
    }
}
